package com.yjt.gcss.gddw.modules.btOrgUserNoMapping;

import javax.annotation.Resource;

import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yjt.common.easyui.datagrid.DataGridDTO;
import com.yjt.common.easyui.datagrid.DataGridJsonDTO;
import com.yjt.gcss.gddw.common.bean.domain.BtOrgUserNoMapping;
import com.yjt.gcss.gddw.common.dao.BtOrgUserNoMappingDao;

@Service(BtOrgUserNoMappingService.BEAN_PACKAGE_NAME)
@Transactional(readOnly=true)
public class BtOrgUserNoMappingService {
	
	public static final String BEAN_PACKAGE_NAME = "com.yjt.gcss.gddw.modules.btOrgUserNoMapping.BtOrgUserNoMappingService";
	
	@Resource(name = BtOrgUserNoMappingDao.BEAN_PACKAGE_NAME)
	private BtOrgUserNoMappingDao btOrgUserNoMappingDao;
	
	public DataGridJsonDTO query(DataGridDTO datagrid, BtOrgUserNoMapping queryModel) {
		btOrgUserNoMappingDao.addOrder(Order.desc("id.jfh"));
		btOrgUserNoMappingDao.addOrder(Order.desc("id.accNo"));
		return btOrgUserNoMappingDao.getBeansByBeanForPager(queryModel, MatchMode.ANYWHERE, datagrid, true);
	}
}
